package com.atguigu.aliyun.oss.auto;

import com.atguigu.aliyun.oss.bean.FileProperties;
import com.atguigu.aliyun.oss.service.FileService;
import com.atguigu.aliyun.oss.service.impl.FileServiceImpl;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
@EnableConfigurationProperties(FileProperties.class)
public class OssServiceAutoConfiguration {
    @Bean
    @ConditionalOnMissingBean(FileService.class)
    public FileService fileService() {
        return new FileServiceImpl();
    }
}
